package com.Xingcang_Dianxue.WhutBank.Models;

import javafx.beans.property.DoubleProperty;
import javafx.beans.property.SimpleDoubleProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;


public class Transaction {
    private final StringProperty sender;
    private final StringProperty receiver;
    private final DoubleProperty amount;
    private final StringProperty date;
    private final StringProperty message;
    private final StringProperty type;

    public Transaction() {
        this.sender = new SimpleStringProperty(this, "sender", "");
        this.receiver = new SimpleStringProperty(this, "Receiver", "");
        this.amount = new SimpleDoubleProperty(this, "Amount", 0.0);
        this.date = new SimpleStringProperty(this, "Date", "");
        this.message = new SimpleStringProperty(this, "Message", "");
        this.type = new SimpleStringProperty(this, "Type", "");
    }

    public Transaction(String sender, String receiver, double amount, String date, String message, String type) {
        this.sender = new SimpleStringProperty(this, "sender", sender);
        this.receiver = new SimpleStringProperty(this, "Receiver", receiver);
        this.amount = new SimpleDoubleProperty(this, "Amount", amount);
        this.date = new SimpleStringProperty(this, "Date", date);
        this.message = new SimpleStringProperty(this, "Message", message);
        this.type = new SimpleStringProperty(this, "Type", type);
    }

    public StringProperty senderProperty() {
        return this.sender;
    }

    public String getSender() {
        return sender.get();
    }

    public void setSender(String sender) {
        this.sender.set(sender);
    }

    public StringProperty receiverProperty() {
        return this.receiver;
    }

    public String getReceiver() {
        return receiver.get();
    }

    public void setReceiver(String receiver) {
        this.receiver.set(receiver);
    }

    public DoubleProperty amountProperty() {
        return this.amount;
    }

    public double getAmount() {
        return amount.get();
    }

    public void setAmount(double amount) {
        this.amount.set(amount);
    }

    public StringProperty dateProperty() {
        return this.date;
    }

    public String getDate() {
        return date.get();
    }

    public void setDate(String date) {
        this.date.set(date);
    }

    public StringProperty messageProperty() {
        return this.message;
    }

    public String getMessage() {
        return message.get();
    }

    public void setMessage(String message) {
        this.message.set(message);
    }

    public StringProperty typeProperty() {
        return this.type;
    }

    public String getType() {
        return type.get();
    }

    public void setType(String type) {
        this.type.set(type);
    }

}
